import 'package:dailypayagent/model/sales.dart';
import 'package:dailypayagent/model/salescount.dart';
import 'package:dailypayagent/provider/view_state_refresh_list_model.dart';
import 'package:dailypayagent/service/wan_android_repository.dart';

class SalesListModel extends ViewStateRefreshListModel<Sales> {
  @override
  Future<List<Sales>> loadData({int pageNum}) async {
    return await WanAndroidRepository.fetchSales();
  }
}

class SalesCountModel extends ViewStateRefreshListModel<SalesCountItem> {
  SalesCount salesCount;
  @override
  Future<List<SalesCountItem>> loadData({int pageNum}) async {
    setBusy();
    salesCount = await WanAndroidRepository.fetchSalesCount();
    setIdle();
    return salesCount.salesList;
  }
}
